﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Cloud.Model;
using Cloud.BLL;

public partial class Three_Managerment_P0454_ZsCon : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {

            if (!IsPostBack)
            {

                int id = Convert.ToInt32(Request.QueryString["id"]);
                ZS_INFO activity = ZS_INFOManager.FindById(id);
                this.lab_fl.InnerText = DWManager.FindById(activity.UNITID).DWMC;
                this.title.Text = activity.TITLE;
                this.content.Text = activity.NOTE;
            }
        }
        catch (Exception ex)
        {

            Response.Write("<script>alert('登陆信息失效,请重新登陆!'); window.parent.location.href='/index.html'</script>");
            return;
        }
    }
    protected void saves_Click(object sender, EventArgs e)
    {
        try
        {

            int id = Convert.ToInt32(Request.QueryString["id"]);
            ZS_INFO activity = ZS_INFOManager.FindById(id);
            activity.TITLE = this.title.Text;
            activity.NOTE = this.content.Text;

            if (ZS_INFOManager.Update(activity) > 0)
            {
                Response.Write("<script>alert('修改成功');location.href='List_Zsk.aspx'</script>");
            }
            else
            {
                Response.Write("<script>alert('修改失败');</script>");
            }
        }
        catch (Exception ex)
        {

            Response.Write("<script>alert('登陆信息失效,请重新登陆!'); window.parent.location.href='/index.html'</script>");
            return;
        }
    }
}